package com.shadow.ui.container.town
{
	import com.shadow.config.EnviromentConfig;
	import com.shadow.manager.UIManager;
	import com.shadow.ui.container.bottom.MyBottomContainer;
	import com.shadow.ui.container.top.BattleTopContainer;
	import com.shadow.ui.container.town.base.TownContainer;
	import com.shadow.ui.map.stage.TutorialMapStage;
	
	import flash.events.Event;

	/**
	 *教程城镇 
	 * @author Liseen
	 * 
	 */	
	public class TutorialTownContainer extends TownContainer
	{
		private var _topContainer:BattleTopContainer;
		private var _bottomContainer:MyBottomContainer;
		
		public function TutorialTownContainer()
		{
			EnviromentConfig.TUTORIAL_MODE = true;
			super();
		}
		
		override protected function initialize():void
		{
			super.initialize();
			
			mapStage = new TutorialMapStage();
			_topContainer = BattleTopContainer.getInstance();
			_bottomContainer = MyBottomContainer.getInstance();
			_topContainer.x = 9;
			_bottomContainer.x = -13;
			_bottomContainer.y = 517;
			
			_topContainer.townContainer = this;
			_topContainer.mapStage = mapStage;
			_bottomContainer.townContainer = this;
			_bottomContainer.mapStage = mapStage;
			
			mapStage.topConatainer = _topContainer;
			
			mapStage.x = (UIManager.MAP_CENTER_POINT_X + 150);
			mapStage.y = (UIManager.MAP_CENTER_POINT_Y - 100);
		}
		
		override protected function addEvent():void
		{
			super.addEvent();
			
			addEventListener(Event.ADDED_TO_STAGE, this.addedToStage);
			
		}
		
		private function addedToStage(event:Event):void
		{
			this._bottomContainer.setBattleLayout();
			this._bottomContainer.tutorialStart();
			
			this.addChild(mapStage);
			this.addChild(focusBoundary);
			this.addChild(this._topContainer);
			this.addChild(this._bottomContainer);
			
		}
	}
}